home *** CD-ROM | disk | FTP | other *** search
/ TeX 1995 July / TeX CD-ROM July 1995 (Disc 1)(Walnut Creek)(1995).ISO / macros / mathematica / tex-mma.tar_z / tex-mma / PSFile.m < prev    next >
Text File  |  1991-02-25  |  821b  |  29 lines

  1. (* 2/25/1991 Dan Dill dan@chem.bu.edu *)
  2.  
  3. PSFile::usage = "PSFile[-graphics-, \"file\"].
  4. Capture a Mathematica graphic object in a PostScript file. Quotes are required
  5. around the file name and suffix `.ps' is added.  The graphic object is
  6. preprocessed through psfix to prepend the Mathematica PostScript procedures to
  7. the file, so that it may be printed directly with lpr.  For example,
  8. \n
  9. \n
  10. \t PSFile[myplot, \"p4/myplot\"]
  11. \n
  12. \n
  13.   will convert the Mathematica graphic myplot to the PostScript file myplot.ps
  14. in the subdirectory p4 of the current directory."
  15.  
  16. PSFile::file = "Graphics being processed (with prolog) to file \"`1`\".";
  17.  
  18. PSFile[g_, f_String] := Block[{filename},
  19.     filename = StringJoin[f, ".ps"];
  20.     Message[PSFile::file, filename];
  21.     Display[StringJoin[
  22.         "! ",
  23.         "psfix",
  24.         " > ",
  25.         filename
  26.         ], g
  27.     ];
  28. ];
  29.